package com.group.model;


/**
 * 蜡烛图 （K线图）
 * @author Zhangyang Hu
 */
public class BitmexExchangeCandles {

    /**
     * id
     */
    private Long id;

    /**
     * 开盘时间
     */
    private Long openTime;

    /**
     * 开盘时间的人类可读格式， 比如 2018-04-25 16:33:26
     */
    private String openTimeDisplay;

    /**
     * 开盘价
     */
    private Double openPrice;

    /**
     * 收盘价
     */
    private Double closePrice;

    /**
     * 最高价
     */
    private Double highestPrice;

    /**
     * 最低价
     */
    private Double lowestPrice;

    /**
     * Base asset 成交量
     */
    private Double baseAssetVolume;

    /**
     * Number of trades, 成交笔数
     */
    private Long tradesCount;

    /**
     * 比如BTCUSDT交易对，base asset就是bitcoin
     */
    private String baseAsset;

    /**
     * 比如BTCUSDT交易对，quote asset就是tether
     */
    private String quoteAsset;

    /**
     * 时间窗口，比如 1m，5m，1d，1w等
     */
    private String timeFrame;

    /**
     * 收盘时间
     */
    private Long closeTime;

    /**
     * 收盘时间的人类可读格式， 比如 2018-04-25 16:33:26
     */
    private String closeTimeDisplay;

    /**
     * Quote asset volume
     */
    private Double quoteAssetVolume;

    /**
     * Taker buy base asset volume
     */
    private Double takerBuyBaseAssetVolume;

    /**
     * Taker buy quote asset volume
     */
    private Double takerBuyQuoteAssetVolume;

    /**
     * 对于期货交易所，它们的交易对比较复杂，所以把交易对也存到数据库中，比如 XBTUSD, ADAM18
     */
    private String symbol;

    /**
     * 交易所名称
     */
    //private String exchange;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getOpenTime() {
        return openTime;
    }

    public void setOpenTime(Long openTime) {
        this.openTime = openTime;

        //2018.04.26
        this.openTimeDisplay = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new java.util.Date(openTime));
    }

    public Double getOpenPrice() {
        return openPrice;
    }

    public void setOpenPrice(Double openPrice) {
        this.openPrice = openPrice;
    }

    public Double getClosePrice() {
        return closePrice;
    }

    public void setClosePrice(Double closePrice) {
        this.closePrice = closePrice;
    }

    public Double getHighestPrice() {
        return highestPrice;
    }

    public void setHighestPrice(Double highestPrice) {
        this.highestPrice = highestPrice;
    }

    public Double getLowestPrice() {
        return lowestPrice;
    }

    public void setLowestPrice(Double lowestPrice) {
        this.lowestPrice = lowestPrice;
    }

    public Double getBaseAssetVolume() {
        return baseAssetVolume;
    }

    public void setBaseAssetVolume(Double baseAssetVolume) {
        this.baseAssetVolume = baseAssetVolume;
    }

    public Long getTradesCount() {
        return tradesCount;
    }

    public void setTradesCount(Long tradesCount) {
        this.tradesCount = tradesCount;
    }

    public String getBaseAsset() {
        return baseAsset;
    }

    public void setBaseAsset(String baseAsset) {
        this.baseAsset = baseAsset;
    }

    public String getQuoteAsset() {
        return quoteAsset;
    }

    public void setQuoteAsset(String quoteAsset) {
        this.quoteAsset = quoteAsset;
    }

    public String getTimeFrame() {
        return timeFrame;
    }

    public void setTimeFrame(String timeFrame) {
        this.timeFrame = timeFrame;
    }

    public Long getCloseTime() {
        return closeTime;
    }

    public void setCloseTime(Long closeTime) {
        this.closeTime = closeTime;

        //2018.04.26
        this.closeTimeDisplay = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new java.util.Date(closeTime));
    }

    public Double getQuoteAssetVolume() {
        return quoteAssetVolume;
    }

    public void setQuoteAssetVolume(Double quoteAssetVolume) {
        this.quoteAssetVolume = quoteAssetVolume;
    }

    public Double getTakerBuyBaseAssetVolume() {
        return takerBuyBaseAssetVolume;
    }

    public void setTakerBuyBaseAssetVolume(Double takerBuyBaseAssetVolume) {
        this.takerBuyBaseAssetVolume = takerBuyBaseAssetVolume;
    }

    public Double getTakerBuyQuoteAssetVolume() {
        return takerBuyQuoteAssetVolume;
    }

    public void setTakerBuyQuoteAssetVolume(Double takerBuyQuoteAssetVolume) {
        this.takerBuyQuoteAssetVolume = takerBuyQuoteAssetVolume;
    }

    public String getOpenTimeDisplay() {
        return openTimeDisplay;
    }

    public void setOpenTimeDisplay(String openTimeDisplay) {
        this.openTimeDisplay = openTimeDisplay;
    }

    public String getCloseTimeDisplay() {
        return closeTimeDisplay;
    }

    public void setCloseTimeDisplay(String closeTimeDisplay) {
        this.closeTimeDisplay = closeTimeDisplay;
    }

    public String getSymbol() {
        return symbol;
    }

    public void setSymbol(String symbol) {
        this.symbol = symbol;
    }

    /**
     public String getExchange() {
     return exchange;
     }

     public void setExchange(String exchange) {
     this.exchange = exchange;
     }**/

    public String toString() {

        return this.baseAsset + "," + this.quoteAsset + "," + this.timeFrame + "," + this.openTime + "," + this.symbol;
    }

}
